<?php echo $this->Html->script('app/menu_admin.js'); ?>
<?php echo $this->Html->script('app/usuarios.js'); ?>

<div class="pageheader">
	<h1 class="pagetitle">Editar Usuário</h1>
	<span class="pagedesc"></span>
</div>

<div id="contentwrapper" class="contentwrapper">
	<div class="msghead_menu">
		<ul>
			<?php if($this->AclLink->check('Usuarios.delete')){ ?>
				<li><?php echo $this->Form->postLink(
					'Deletar',
					array('action' => 'delete', $usuario['Usuario']['id']),
					array('confirm' => 'Você tem certeza?', 'escape' => false));
				?></li>
			<?php } ?>
			<li><?php echo $this->Html->link('Voltar', array('action' => 'index'), array()); ?></li>
		</ul>
	</div>
	</br></br>

	<?php echo $this->Form->create('Usuario', array('type' => 'file', 'class' => 'stdform stdform2')); ?>

	<?php echo $this->element('errors', array('errors' => $errors)); ?>

	<p class="first">
		<label class="less">Perfil <span class="red">*<span></label>
		<span class="field less">
			<?php echo $this->Form->input('perfil_id', array('error' => false, 'label' => false, 'div' => false, 'empty' => 'Perfil')); ?>
		</span>
	</p>

	<p>
		<label class="less">Email <span class="red">*<span></label>
		<span class="field less">
			<?php echo $this->Form->input('email', array('type' => 'text', 'error' => false, 'required' => false, 'label' => false, 'div' => false, 'class' => 'smallinput')); ?>
		</span>
	</p>

	<p>
		<label class="less">Login <span class="red">*<span></label>
		<span class="field less">
			<?php echo $this->Form->input('username', array('error' => false, 'required' => false, 'label' => false, 'div' => false, 'class' => 'smallinput')); ?>
		</span>
	</p>

	<p>
		<label class="less">Senha <span class="red">*<span></label>
		<span class="field less">
			<?php echo $this->Form->input('password', array('error' => false, 'required' => false, 'label' => false, 'div' => false, 'class' => 'smallinput')); ?>
		</span>
	</p>

	<p>
		<label class="less">Confirmação senha <span class="red">*<span></label>
		<span class="field less">
			<?php echo $this->Form->input('password2', array('type' => 'password', 'error' => false, 'required' => false, 'label' => false, 'div' => false, 'class' => 'smallinput')); ?>
		</span>
	</p>

	<?php if($this->AclLink->check('Usuarios.crop')){ ?>
		<p>
			<label class="less">Foto</label>
			<span class="field less">
				<?php echo $this->Form->input('Usuario.photo', array('type' => 'file', 'label' => false, 'div' => false, 'error' => false)); ?>
				<?php echo $this->Form->input('Usuario.photo_dir', array('type' => 'hidden')); ?>
			</span>
		</p>
	<?php } ?>

	<p>
		<label class="less">Ativo</label>
		<span class="field medium">
			<?php echo $this->Form->checkbox('ativo', array('error' => false, 'div' => false)); ?>
		</span>
	</p>

	<?php echo $this->Form->input('id', array('type' => 'hidden')); ?>

	<p class="stdformbutton">
		<?php echo $this->Form->button('Salvar', array('class' => 'stdbtn btn_blue')); ?>
	</p>

	<?php echo $this->Form->end() ?>
</div>